<html  xmlns:th="http://www.thymeleaf.org">
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <title></title>
    <!-- 引入 jQuery Mobile 样式 -->
    <link rel="stylesheet" href="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <!-- 引入 jQuery 库 -->
    <script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
    <!-- 引入 jQuery Mobile 库 -->
    <script src="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>


    <link href="https://cdn.bootcss.com/jquery-mobile/1.4.5/jquery.mobile.theme.css" rel="stylesheet">

    <script src="https://cdn.bootcss.com/jquery-validate/1.16.0/jquery.validate.js"></script>
    <script src="https://cdn.bootcss.com/jquery.form/4.2.1/jquery.form.js"></script>
    <script src="/weixin/js/jquerymobile_popup.js"></script>
    <script type="text/javascript">
        function login(){
                var email=$("#email").val();

                if(email==""){
                    openPopup('邮箱不能为空','提示',undefined,true,undefined,'error','cn');
                    return;
                }
                var wid=$("#wid").val();
                var openid=$("#openid").val();
                $.ajax({
                    type:"get",
                    url:"/user/login",
                    data:{"email":email,"wid":wid,"openid":openid},
                    success:function(obj){
                        if(obj.code=="2003"){
                           openPopup('邮箱不存在，请联系管理员进行后台申请','提示',undefined,true,undefined,'error','cn');
                           // alert("邮箱不存在，请联系管理员进行后台申请");
                        }else if(obj.code=="2002"){
                            alert("邮箱已被人绑定,请联系管理员");
                           // openPopup('邮箱已被人绑定,请联系管理员','提示',undefined,true,undefined,'error','cn');

                        }else{
                           // openPopup('绑定成功','提示',undefined,true,undefined,'error','cn');
                            WeixinJSBridge.call('closeWindow');
                        }

                    }

                });


            //	openPopup('信息提示','提示',undefined,true,undefined,'error','cn');
            //	WeixinJSBridge.call('closeWindow');
        }
    </script>
    <style type="text/css">
        .ui-page{
            background:#eee;
        }
    </style>
</head>
<body>

<div data-role="page" id="pageMain" style="background-color: #4E90C7;">
    <div style="text-align:center;"><img src="/weixin/images/dada_logo1.png" style="width: 100%;"></div>


    <div data-role="content" class="content">
            <input type="hidden" id="wid" name="wid" th:value="${wid}"/>
        <input type="hidden" id="openid" name="openid" th:value="${openid}"/>
        <form id="login_params" method="post" >
            <div>
                <input type="text" id="email" name="email" placeholder="公司邮箱" style="background: url('/weixin/images/ic_mail.png') no-repeat 5px;background-size: 30px;padding-left:40px;">



            </div>
            <div align="center" style="padding-top:30px;">
                <input id="pubBtn" type="button" value="登录"  onclick="login();" style="padding:10px;background: #E57330;text-shadow: none;opacity:100;color:white;font-size:20px;text-indent:0px;font-family:微软雅黑;border: none;-webkit-appearance:none;-moz-appearance:none;width: 100%;border-radius:7px;" >
            </div>
        </form>

    </div>
</div>


</body>
</html>
